var express = require('express');
var router = express.Router();

module.exports = {
    makeUser : function () {
        const user = {};
        user.id = 0;
        user.imageflag = false;
        user.imagefile = "";
        user.name = "";
        user.password = "";
        user.permissions = "user";
        user.introduction = "";
        user.email = "";

        user.taskNum = 0;
        user.taskTitle = [];
        user.taskContent = [];
        user.taskPublisher = [];
        user.taskDate = [];

        return user;
    },
    enterUser : function () {
        let user = this.makeUser();

        user.id = global.interimUser.id;
        user.name = global.interimUser.name;
        user.password = global.interimUser.password;
        user.imageflag = global.interimUser.imageflag;
        user.imagefile = global.interimUser.imagefile;
        user.permissions = global.interimUser.permissions;
        user.introduction = global.interimUser.introduction;
        user.email = global.interimUser.email;

        user.taskNum = global.interimUser.taskNum;
        user.taskTitle = global.interimUser.taskTitle;
        user.taskContent = global.interimUser.taskContent;
        user.taskDate = global.interimUser.taskDate;
        user.taskPublisher = global.interimUser.taskPublisher;

        return user;
    }
};